// 组件模型
module.exports = (app) => {
      const mongoose = app.mongoose;
      const Schema = mongoose.Schema;

      const ComponentSchema = new Schema(
            {
                  __v: { type: Number, select: false },
                  componentName: { type: String, required: true },
                  componentIcon: { type: String, required: true },
                  componentTitle: { type: String, required: true },
            },
            { timestamps: true }
      );
      // timestamps:true 【会在表中自动添加一个createTime和updateTime两个字段】
      return mongoose.model("Components", ComponentSchema);
};